<template>
  <div>
    <el-popover placement="bottom" trigger="hover">
      <div class="img_box">
        <!-- <img slot="reference" :src="qrCode" class="code_img_bg" alt="" /> -->
        <el-image :src="qrCode" class="code_img_bg"></el-image>
        <span> 扫码查看详情 </span>
      </div>
      <img slot="reference" src="@/assets/1code.png" class="code_img" alt="" />
    </el-popover>
  </div>
</template>

<script>
export default {
  props: {
    qrCode: {
      type: String,
      default: "",
    },
  },
  data() {
    return {};
  },
  mounted() {
    // this.qrCode =
    //   "data:image/png;base64," +
    //   btoa(
    //     new Uint8Array(r).reduce(
    //       (data, byte) => data + String.fromCharCode(byte),
    //       ""
    //     )
    //   );
  },
};
</script>

<style lang='scss' scoped>
.code_img {
  width: 29px;
  height: 29px;
  cursor: pointer;
}
.img_box {
  padding: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  span {
    font-size: 14px;
    color: rgba(0, 0, 0, 0.65);
    margin-top: 6px;
  }
  .code_img_bg {
    width: 140px;
    height: 140px;
  }
}
</style>